package com.ticket.sass.admin.dto.input.config;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * @author ywb
 * @date 2024-03-25 18:06
 */
@Data
@ApiModel
public class CinemaConfigInput {
    @NotNull
    @ApiModelProperty(value = "主键")
    private Long id;
    
    @NotBlank(message = "影院名称不能为空")
    @ApiModelProperty(value = "影院名称", required = true)
    private String name;
    
    @NotBlank(message = "影院简称不能为空")
    @ApiModelProperty(value = "影院简称", required = true)
    private String shortName;
    
    @ApiModelProperty(value = "影院LOGO")
    private String logo;
    
    @ApiModelProperty(value = "经度")
    private Double lng;
    
    @ApiModelProperty(value = "纬度")
    private Double lat;
    
    @Pattern(regexp="^[0-9]*$", message="必须为数字")
    @ApiModelProperty(value = "区域编码")
    private String areaCode;
    
    @NotBlank(message = "影院地址不能为空")
    @ApiModelProperty(value = "地址", required = true)
    private String addr;
    
    @ApiModelProperty(value = "联系方式")
    @Valid // 添加 @Valid 注解，启用嵌套验证
    private List<@Pattern(regexp="^(1[3456789]\\d{9}|0\\d{2,3}-?\\d{7,8})$", message="必须是手机号或座机号") String> contact;
    
    @Valid
    @ApiModelProperty(value = "通知")
    private List<NoticesConfigInput> notices;
}
